package com.donleo.stmg.entity.mapper;

import com.donleo.stmg.entity.model.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.donleo.stmg.entity.vo.PermissionVo;

import java.util.List;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    List<Permission> findAll(PermissionVo permissionVo);

    long getCount(PermissionVo permissionVo);

    /**
     * 根据角色编号查权限
     */
    List<Permission> findPmsByRoleCode(String roleCode);

    /**
     * 根据Id集合查询
     *
     * @param pmsIds List
     * @return Permission
     */
    List<Permission> findPmsByIds(List<Integer> pmsIds);

    /**
     * 根据用户生成菜单
     *
     * @param userCode
     * @return
     */
    List<Permission> findUserMenuPermission(String userCode);
}
